home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / cool / ge_cool.lha / GE_COOL2.1 / man / oldman3 / Pair.3T~ < prev    next >
Text File  |  1992-06-26  |  3KB  |  101 lines

  1. .TH PAIR
  2. .SH NAME
  3. Pair<T1,T2>  A parameterized pair
  4. .SH SYNOPSIS    
  5. #include <cool/Pair.h>
  6. .SH DESCRIPTION
  7. The parameterized \f3Pair<T1,T2>\f1 class implements an association between one 
  8. object and another. The objects may be of different types, with the first 
  9. representing the 
  10.  key 
  11. of the pair and the second representing the 
  12.  value 
  13. of the 
  14. pair. The \f3Pair<T1,T2>\f1 class is used by the \f3Association<Ktype,Vtype>\f1 class to 
  15. implement an association list (that is, a vector of pairs of associated 
  16. values).
  17. .SH Base Classes
  18. None
  19. .SH Friend Classes
  20. None
  21. .SH Constructors
  22. .TP
  23. \f3Pair<T1,T2> \f3();\f1
  24. Creates an empty pair of the specified types.
  25. .TP
  26. \f3Pair<T1,T2> \f3(const Pair<T1,T2>>>&\f3);\f1
  27. Duplicates the size and value of a pair object.
  28. .TP
  29. \f3Pair<T1,T2> (const \f2T1&\f3, const \f2T2&\f3);\f1
  30. Creates a pair from the two specified elements.
  31. .SH Member Functions
  32. .TP
  33. \f3inline const \f2T1& \f3get_first () const;\f1
  34. Returns a constant reference to the first element of the pair.
  35. .TP
  36. \f3inline const \f2T2& \f3get_second () const;\f1
  37. Returns a constant reference to the second element of the pair.
  38. .TP
  39. \f3inline T1& first ();\f1
  40. Returns a reference to the first element of the pair.
  41. .TP
  42. \f3Pair<T1,T2>& \f3operator=  (Pair<T1,T2>>>&\f3);\f1
  43. Assigns one pair object to have the value of another by duplicating element 
  44. values.
  45. .TP
  46. \f3Boolean operator== (Pair<T1,T2>&)\f3 const;\f1
  47. Returns 
  48.  
  49.  TRUE 
  50. if the pairs have the same element values; otherwise, this 
  51. function returns
  52.   FALSE .
  53. .TP
  54. \f3inline Boolean operator!= (Pair<T1,T2>>>&\f3) const;\f1
  55. Returns 
  56.  
  57.  TRUE 
  58. if the pairs have different element values; otherwise, this 
  59. function returns 
  60.  FALSE .
  61. .TP
  62. \f3inline T2& second ();\f1
  63. Returns a reference to the second element of the pair.
  64. .TP
  65. \f3inline void set_compare (\f2Pair_Compare \f3= NULL);\f1
  66. Updates the compare function for this class of pair. 
  67.  Pair_Compare 
  68. is a function 
  69. of type 
  70.  Boolean 
  71. (\f2*Function\f1)(\f3const Pair<T1,T2>&\f1, \f3const Pair<T1,T2>&\f1). If no 
  72. argument is provided, the 
  73.  operator== 
  74. for the types over which the class is 
  75. parameterized are used.
  76. .TP
  77. \f3inline void set_first (const \f2T1&\f3);\f1
  78. Sets the first element of the pair to the specified value.
  79. .TP
  80. \f3inline void set_second (const \f2T2&\f3);\f1
  81. Sets the second element of the pair to the specified value.
  82. .SH Friend Functions
  83. .TP
  84. \f3friend ostream& operator<< (ostream& \f2os\f3, const Pair<T1,T2>>>&\f3);\f1
  85. Provides a formatted output capability for reference to a \f3Pair<T1,T2>\f1 object.
  86. .TP
  87. \f3inline friend ostream& operator<< (ostream& \f2os\f3, const Pair<\f2T1,T2>*);\f1
  88. Provides a formatted output capability for a pointer to a \f3Pair<T1,T2>\f1 object.
  89. .SH COPYRIGHT
  90.  
  91. Copyright (C) 1991 Texas Instruments Incorporated.
  92.  
  93. Permission is granted to any individual or institution to use, copy, modify,
  94. and distribute this software, provided that this complete copyright and
  95. permission notice is maintained, intact, in all copies and supporting
  96. documentation.
  97.  
  98. Texas Instruments Incorporated provides this software "as is" without
  99. express or implied warranty.
  100.  
  101.